export class StorageManager {
    async getSettings() {
        return new Promise((e => {
            chrome.storage.sync.get(["apiKey", "language", "model", "selectionEnabled", "rememberWindowSize", "pinWindow"], (n => {
                e({
                    apiKey: n.apiKey || "",
                    language: n.language || "en",
                    model: n.model || "v3",
                    selectionEnabled: void 0 === n.selectionEnabled || n.selectionEnabled,
                    rememberWindowSize: void 0 !== n.rememberWindowSize && n.rememberWindowSize,
                    pinWindow: void 0 !== n.pinWindow && n.pinWindow
                })
            }))
        }))
    }
    async saveLanguage(e) {
        return new Promise((n => {
            chrome.storage.sync.set({
                language: e
            }, n)
        }))
    }
    async saveModel(e) {
        return new Promise((n => {
            chrome.storage.sync.set({
                model: e
            }, n)
        }))
    }
    async saveSelectionEnabled(e) {
        return new Promise((n => {
            chrome.storage.sync.set({
                selectionEnabled: e
            }, n)
        }))
    }
    async saveRememberWindowSize(e) {
        return new Promise((n => {
            chrome.storage.sync.set({
                rememberWindowSize: e
            }, n)
        }))
    }
    async savePinWindow(e) {
        return new Promise((n => {
            chrome.storage.sync.set({
                pinWindow: e
            }, n)
        }))
    }
}